﻿using Appliaction.Dto.Sinv;
using Domain.Entitys.Sinv;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Appliaction.IAppServices.Sinv
{
    public interface ISinv_Sale_OrderService
    {
        /// <summary>
        /// 查询销售订单及其详情
        /// </summary>
        /// <param name="currendPage"></param>
        /// <param name="pageSize"></param>
        /// <param name="customerName"></param>
        /// <param name="orderCode"></param>
        /// <returns></returns>
        List<Sinv_Sale_Order_Info> GetSinv_Sale_Infos(int currendPage, int pageSize, string customerName, string orderCode, string proName, int orderStatus, char auditStatus);

        /// <summary>
        /// 查询销售订单总数
        /// </summary>
        /// <param name="customerName"></param>
        /// <param name="orderCode"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_OrderCOuntAsync(string customerName, string orderCode, string proName, int orderStatus, char auditStatus);

        /// <summary>
        /// 添加销售订单信息和销售明细
        /// </summary>
        /// <param name="saleOrderWithDetailsDto"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_OrderAddAsync(SaleOrderWithDetailsDto<Sinv_Sale_OrderAddDto> saleOrderWithDetailsDto);

        /// <summary>
        /// 逻辑删除销售订单信息
        /// </summary>
        /// <param name="sinv_Sale_OrderDelDto"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_OrderDelAsync(Sinv_Sale_OrderDelDto sinv_Sale_OrderDelDto);

        /// <summary>
        /// 根据销售订单编号查询对应销售订单信息
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<Sinv_Sale_Order> GetSinv_Sale_OrderByCodeAsync(string code);

        /// <summary>
        /// 根据销售订单编号查询销售明细
        /// </summary>
        /// <returns></returns>
        Task<List<Sinv_Sale_Order_Details>> GetSinv_Sale_Order_DetailsByCodeAsync(string code);

        /// <summary>
        /// 修改销售订单及其明细
        /// </summary>
        /// <param name="saleOrderWithDetailsDto"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_OrderUpdateAsync(SaleOrderWithDetailsDto<Sinv_Sale_OrderUpdateDto> saleOrderWithDetailsDto);

        /// <summary>
        /// 修改销售订单审核状态
        /// </summary>
        /// <param name="_Sale_OrderAuditUpdateDto"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_OrderAuditUpdateAsync(Sinv_Sale_OrderAuditUpdateDto _Sale_OrderAuditUpdateDto);

        /// <summary>
        /// 分页条件查询销售订单信息
        /// </summary>
        /// <param name="currentPage">当前页</param>
        /// <param name="pageSize">每页查询数</param>
        /// <param name="orderCode">销售订单编号</param>
        /// <param name="status">订单状态</param>
        /// <param name="customerName">客户名称</param>
        /// <param name="rep_id">负责人</param>
        /// <param name="dept_id">销售部门</param>
        /// <returns></returns>
        Task<List<Sinv_Sale_Order>> Sinv_Sale_OrderSelectAsync(int currentPage, int pageSize, string orderCode, int status, string customerName, int rep_id, int dept_id);

        /// <summary>
        /// 条件查询销售订单总数
        /// </summary>
        /// <param name="orderCode"></param>
        /// <param name="status"></param>
        /// <param name="customerName"></param>
        /// <param name="rep_id"></param>
        /// <param name="dept_id"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_OrderSelectCountAsync(string orderCode, int status, string customerName, int rep_id, int dept_id);

        /// <summary>
        /// 分页条件查询销售订单明细
        /// </summary>
        /// <param name="currentId"></param>
        /// <param name="pageSize"></param>
        /// <param name="code"></param>
        /// <param name="productCode"></param>
        /// <param name="measureId"></param>
        /// <returns></returns>
        Task<List<Sinv_Sale_Order_Details>> GetSinv_Sale_Order_DetailsAsync(int currentPage, int pageSize, string code, string productCode, int measureId);

        /// <summary>
        /// 条件查询销售订单明细总数
        /// </summary>
        /// <param name="code"></param>
        /// <param name="productCode"></param>
        /// <param name="measureId"></param>
        /// <returns></returns>
        Task<int> GetSinv_Sale_Order_DetailsCountAsync(string code, string productCode, int measureId);

        /// <summary>
        /// 分页条件查询出库销售订单信息
        /// </summary>
        /// <param name="currentPage">当前页</param>
        /// <param name="pageSize">每页查询数</param>
        /// <param name="orderCode">销售订单编号</param>
        /// <param name="status">订单状态</param>
        /// <param name="customerName">客户名称</param>
        /// <param name="rep_id">负责人</param>
        /// <param name="dept_id">销售部门</param>
        /// <returns></returns>
        Task<List<Sinv_Sale_Order>> Sinv_Sale_OrderSelectFillAsync(int currentPage, int pageSize, string orderCode, int status, string customerName, int rep_id, int dept_id);

        /// <summary>
        /// 条件出库查询销售订单总数
        /// </summary>
        /// <param name="orderCode"></param>
        /// <param name="status"></param>
        /// <param name="customerName"></param>
        /// <param name="rep_id"></param>
        /// <param name="dept_id"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_OrderSelectFillCountAsync(string orderCode, int status, string customerName, int rep_id, int dept_id);

        /// <summary>
        /// 根据客户名称、销售订单名称、产品名称查询汇总
        /// </summary>
        /// <param name="customerName"></param>
        /// <param name="saleOrserName"></param>
        /// <param name="proName"></param>
        /// <returns></returns>
        List<Sinv_Sale_Order_Info> GetSinv_Sale_InfosSummary(string customerName, string saleOrserName, string proName);

        /// <summary>
        /// 销售订单撤销
        /// </summary>
        /// <param name="sinv_Sale_Order"></param>
        /// <returns></returns>
        Task<int> Sinv_Sale_OrderRevokeAsync(Sinv_Sale_OrderRevokeDto sinv_Sale_Order);
    }
}
